
package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import com.joysuch.wwyt.core.enums.RiskLevels;
import org.springframework.stereotype.Component;

@Component
public class ImportRiskLevelConvertor implements FieldValueConvert<String, Integer> {

    @Override
    public Integer convert(Object bean, String value, DataDumpField dataField) {
        RiskLevels level = RiskLevels.findByName(value);
        return level == null ? null : level.getCode();
    }

}
